package com.eastcode.dictionary.view;

import java.util.HashMap;
import java.util.Map;

import com.eastcode.base.util.StringUtil;
import com.eastcode.base.view.BaseView;
import com.eastcode.mobile.server.util.ServerConstant;

public class DictionaryView extends BaseView {

	private String searchName;

	private String searchCode;

	private String searchState;

	public String getSearchName() {
		return searchName;
	}

	public void setSearchName(String searchName) {
		this.searchName = searchName;
	}

	public String getSearchCode() {
		return searchCode;
	}

	public void setSearchCode(String searchCode) {
		this.searchCode = searchCode;
	}

	public String getSearchState() {
		return searchState;
	}

	public void setSearchState(String searchState) {
		this.searchState = searchState;
	}

	public Map<String, String> getStateMap() {
		return ServerConstant.stateMap;
	}

	public Map<String, String> getParamMap() {
		Map<String, String> paramMap = new HashMap<String, String>();

		if (!StringUtil.isEmpty(getSearchCode())) {
			paramMap.put("code", getSearchCode());
		}

		if (!StringUtil.isEmpty(getSearchName())) {
			paramMap.put("name", getSearchName());
		}

		if (!StringUtil.isEmpty(getSearchState())) {
			paramMap.put("state", getSearchState());
		}

		return paramMap;
	}
}
